package com.zcg.gasmanager.dao.impl;


import javax.annotation.Resource;

import org.hibernate.Session;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Component;

import com.zcg.gasmanager.dao.LogDao;
import com.zcg.gasmanager.model.Log;
import com.zcg.gasmanager.utils.HibernateUtil;

@Component("logDao")
public class LogDaoImpl implements LogDao {
	
	private HibernateTemplate hibernateTemplate;
	
	@Override
	public void add(Log log)  throws RuntimeException{
		try {
			hibernateTemplate.save(log);
		} catch (DataAccessException e) {
			e.printStackTrace();
		}
	}

	public HibernateTemplate getHibernateTemplate() {
		return hibernateTemplate;
	}
	
	@Resource
	public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
		this.hibernateTemplate = hibernateTemplate;
	}

}